﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using TPTecnicas.MessageProcessor.Common;
using TPTecnicas.MessageProcessor.Business;
using System.ComponentModel.Composition;


namespace TPTecnicas.MessageProcessor.Rules
{
    [Export(typeof(IRule))]
    [ExportMetadata("Name", "ConsultaPublica")]
    public class ConsultaPublica : Consulta
    {
        [ImportingConstructor]
        public ConsultaPublica([Import("context")]IUniversityContext context)
            : base(context)
        {

        }

        protected override Match GetMatch(IMessage message)
        {
            var regex = new Regex(@"^\[CONSULTA-PUBLICA\] (?<tema>.*)$");
            return regex.Match(message.Subject);
        }
    }
}
